package com.xiaoxiaoxt.xiaoxiaoxtdao.mapper;

import com.xiaoxiaoxt.xiaoxiaoxtdao.entity.Member;
import com.xiaoxiaoxt.xiaoxiaoxtdao.entity.MemberHome;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;


public interface MemberHomeMapper extends Mapper<MemberHome> {
   List<MemberHome> selectParents(Integer mid);
   List<MemberHome> selectChildren(Integer mid);

   @Select("select * from dede_member m, dede_member_home mh where mh.mid = m.mid and mh.pid = #{parentId} limit 1")
   Member selectOneByParentId(Integer parentId);

   @Select("select * from dede_member m, dede_member_home mh where mh.mid = m.mid and mh.pid = #{parentId}")
   List<Member> selectByParentId(Integer parentId);
}